package org.csu.mypetstore_ssm.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class webConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射外部目录为 /images/**
        registry.addResourceHandler("/image/**")

                .addResourceLocations("file:C:/mypetstore/image/"); // Windows
    }
}